using System;
using UnityEngine;

[Serializable]
public class back : MonoBehaviour
{
	public AudioClip clip;

	public GUISkin skin;

	public bool basescene;

	private float originalWidth;

	private float originalHeight;

	public Vector2 scale;

	public back()
	{
		originalWidth = 640f;
		originalHeight = 360f;
	}

	public void Start()
	{
		if (Screen.width > 640)
		{
			scale.x = ((float)Screen.width + 0f) / originalWidth;
			scale.y = ((float)Screen.height + 0f) / originalHeight;
		}
		else
		{
			scale.x = 1f;
			scale.y = 1f;
		}
		if (Screen.width > 1020)
		{
			scale.x = 1024f / originalWidth;
			scale.y = 600f / originalHeight;
		}
	}

	public void OnGUI()
	{
		GUI.skin = skin;
		if (GUI.Button(new Rect((float)(Screen.width / 2) - 142f * scale.x, (float)(Screen.height / 20) + 2f * scale.y, 100f * scale.x, 25f * scale.y), "Exit"))
		{
			AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
			Time.timeScale = 1f;
			Time.fixedDeltaTime = 0.033f;
			if (!basescene)
			{
				UnityEngine.SceneManagement.SceneManager.LoadScene("stadiumselectload");
			}
			else
			{
				UnityEngine.SceneManagement.SceneManager.LoadScene("mainmenu2");
			}
		}
		if (GUI.Button(new Rect((float)(Screen.width / 2) + 42f * scale.x, (float)(Screen.height / 20) + 2f * scale.y, 100f * scale.x, 25f * scale.y), "Resume"))
		{
			AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
			Time.timeScale = 1f;
			Time.fixedDeltaTime = 0.033f;
			UnityEngine.Object.Instantiate(Resources.Load("HideAdsR"));
			(gameObject.GetComponent("back") as back).enabled = false;
			restartbutton restartbutton = gameObject.GetComponent("restartbutton") as restartbutton;
			if ((bool)restartbutton)
			{
				restartbutton.enabled = false;
			}
			restart restart = gameObject.GetComponent("restart") as restart;
			if ((bool)restart)
			{
				restart.enabled = true;
			}
			enabled = false;
		}
	}

	public void Main()
	{
	}
}
